package org.hzz.promotions.types.enums.code;

import io.gitee.pkmer.convention.enums.BaseEnum;
import io.gitee.pkmer.convention.enums.BaseEnumTemplate;
import lombok.Getter;

/**
 * @author <a href="mailto:1193094618@qq.com">pkmer</a>
 * <br>
 * <a href = "https://gitee.com/developeros/videos-online">Code Repository</a>
 * At 2024/8/31
 * 兑换码状态
 */
@Getter
public enum CodeStatus implements BaseEnum<Integer> {
   // 兑换码状态， 1：待兑换，2：已兑换，3：兑换活动已结束
    UN_EXCHANGE( 1, "待兑换"),
    EXCHANGED( 2, "已兑换"),
    EXCHANGE_END( 3, "兑换活动已结束");

    private final Integer value;
    private final String desc;

    CodeStatus(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static CodeStatus fromValue(Byte value) {
        return BaseEnumTemplate.fromByteValue(CodeStatus.class, value);
    }
}
